home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: symbol type at runtime
- Date: Sun, 24 Mar 96 16:34:22 GMT
- Organization: none
- Message-ID: <827685262snz@genesis.demon.co.uk>
- References: <m0tzg3i-0001lOC@hammy.lonestar.org> <Pine.OSF.3.91.960322023421.12217A-100000@krtkg1.rug.ac.be>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <Pine.OSF.3.91.960322023421.12217A-100000@krtkg1.rug.ac.be>
- colle@krtkg1.rug.ac.be "Christophe Colle" writes:
-
- >> >I wonder if there is a way to find out the type of a variable at runtime,
- >> >without using tricks like #define etc.
- >>
- >> No. If you want your function to know the size of an array you
- >> passed, you'll have to pass the size, somehow.
- >
- >I beleieve you when you say it is not in C, but there must be a way to
- >find it, like debuggers do.
-
- The only way that debuggers can find it is if you explicitly asked your
- compiler to add extra debugging information to the object file (e.g. using
- gcc -g). It is not part of nor accessible to normal code.
-
- Like when I fireup gdb, without the sources
- >online it knows about the types... I'ld like to write something to debug
- >more than gdb does. One of the things I wanna do is to check if i'm
- >writing out of the bounds of an array.
-
- You need to find out about debugging data formats.
-
- >Maybe I'll have to use the COFF-format to know more about variables, but
- >since i have other work to do and i don't know where to look for books on
- >the COFF-format I posted my question in this newsgroup.
-
- What you need is inherently system specific.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-